Page({
  data: {
    relet_order_no: '', // 续租订单号
    reletInfo: {}
  },
  onLoad({relet_order_no, platform}) {
    my.setNavigationBar({
      frontColor: '#000000',
      backgroundColor: '#f6f6f6'
    })
    this.setData({
      relet_order_no
    })
    let app = getApp();
    app.setShareChannel(platform)
  },
  onReady() {
    this.getOrderSuccess()
  },
  getOrderSuccess() {
    const { relet_order_no } = this.data
    let app = getApp()
    my.request({
      url: `${app.globalData.testUrl}/api/relet/reletSuccess`,
      method: 'POST',
      data: {
        zm_user_id: app.globalData.user_id,
        relet_order_no
      },
      success: ({data: { data, code , msg:content}}) => {
        if(code !== 1) {
          my.showToast({
            type: 'none',
            content,
            duration: 1000
          })
          return
        }
        this.setData({
          reletInfo: data
        })
      }
    })
  },
  return_list() {
    my.redirectTo({
      url: '/page/mine/myorders/myorders?id=13'
    })
  },
  jumpPage() {
    const { relet_order_no } = this.data
    my.navigateTo({
      url: `/page/mine/myorders/renewalDetail/renewalDetail?relet_order_no=${relet_order_no}`
    })
  }
});
